home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr08 / sqledit.zip / SQLEDIT.INF (.txt) < prev    next >
OS/2 Help File  |  1993-06-04  |  8KB  |  154 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4.  
  5.                 Copyright 1993 Ammonoosuc Technology, Inc.
  6.  
  7.   SQLEdit allows the user to enter an arbitrary SQL SELECT query, run an 
  8. existing stored query, edit and run an existing stored query, or execute a 
  9. query stored in a file. The output of this query is displayed in a window on 
  10. the screen. The user may then choose to INSERT a new row using an existing 
  11. output row as a starting point and editing it to create the new row. (S)he may 
  12. also choose to DELETE in the base table a row which is being displayed. As a 
  13. third choice, (s)he may UPDATE selected columns in an existing output row. 
  14.  
  15.   When editing of the data being displayed has been completed, the user then 
  16. tells the program to actually perform the data base modifications. Each 
  17. modified or new row becomes the subject of a separate SQL INSERT, UPDATE, or 
  18. DELETE transaction. Some (or all) of the transactions may fail if they are 
  19. invalid. Reasons for invalidity are manifold. They may include lack of 
  20. authorization, modifying a table which is actually a read-only view, etc. In 
  21. any case, for every failing transaction, a suitable SQL error message will be 
  22. displayed. 
  23.  
  24.  
  25. ΓòÉΓòÉΓòÉ 2. Data Base Selection ΓòÉΓòÉΓòÉ
  26.  
  27.   Upon activation, the program will display a list of existing data bases. The 
  28. user must select one of them which will become the active database for the 
  29. current session. Selection may be accomplished either by selecting an entry and 
  30. then pressing the ENTER push button, or by double clicking on the desired 
  31. entry. It is assumed that the user is familiar with the contents of each of the 
  32. data bases and knows which (s)he wants to edit. No browsing facilities are 
  33. included with this program. If there is only a single data base, this selection 
  34. process will be bypassed. 
  35.  
  36.  
  37. ΓòÉΓòÉΓòÉ 3. Query Selection and Composition ΓòÉΓòÉΓòÉ
  38.  
  39.   At this point, the user may select from a menu bar either to execute an ad 
  40. hoc (COMPOSED) SQL query or to execute or edit an existing stored query. This 
  41. query may be stored either in the database or in an external file. If (s)he 
  42. chooses to compose an ad hoc query, (s)he will be presented with a window in 
  43. which the query may be composed. When (s)he is done composing the query, (s)he 
  44. should press the ENTER button and the query will be executed. If the user 
  45. chooses to work with a stored query and there are no stored queries, the stored 
  46. query section of the menu bar will be disabled and (s)he must choose to either 
  47. compose a query or select a file containing a query. If the user chooses to 
  48. work with a query stored in the database and there is more than one stored 
  49. query in the database, a list of all the stored queries in the database will be 
  50. presented. The user must choose one of them. Selection may be accomplished 
  51. either by selecting an entry and then pressing the ENTER push button, or by 
  52. double clicking on the desired entry. If there is only a single stored query in 
  53. the data base, this selection is bypassed. If the user has elected to edit an 
  54. existing stored query, the text of the stored query will be displayed in an 
  55. edit window where it may be modified. When editing is completed, the user 
  56. should press the ENTER button and the edited query will be executed. Otherwise, 
  57. if editing is not invoked, an existing stored query will be directly executed. 
  58. If the user specifies a query stored in an external file, it is assumed that 
  59. this file is a text file containing a single query. If this option is selected, 
  60. a file selection box will be presented to the user. When a file has been 
  61. selected, it will be read and the contents executed as a query. The text in 
  62. this file will be completely unedited when it is executed as a query. 
  63.  
  64.  
  65. ΓòÉΓòÉΓòÉ 4. Query Execution and Data Presentation ΓòÉΓòÉΓòÉ
  66.  
  67.   When the SQL query is executed, if execution is unsuccessful, a standard SQL 
  68. error message will be displayed explaining why the query is in error. A further 
  69. explanation of the error may be found in the normal SQL error message manual. 
  70. At this point, the query selection process will restart. Otherwise, the output 
  71. of the query will be displayed in a window. The format of this output display 
  72. depends only on the stored data and is independent of any stored forms or other 
  73. external formatting information. The order in which columns are displayed 
  74. depends only on their order in the query. All data types may be displayed in 
  75. this window except LONG VARCHAR. Queries that return LONG VARCHAR data are not 
  76. supported. This window may be scrolled both horizontally and vertically if 
  77. necessary to display all the data. This window is fixed in size and may not be 
  78. resized. 
  79.  
  80.  
  81. ΓòÉΓòÉΓòÉ 5. Creating INSERT Transactions ΓòÉΓòÉΓòÉ
  82.  
  83.   The philosophy behind executing an INSERT transaction is to choose an 
  84. existing row as a model for the new row, duplicate it, and edit it until we 
  85. have the row we want to insert, keeping th number of columns the same. To 
  86. accomplish this , single click on the INSERT button using mouse button 1. Then 
  87. position the cursor anywhere on the row to be duplicated and single click using 
  88. mouse button 2. This will cause a copy of the selected row to be appended to 
  89. the end of the display. This appended row will be displayed in the same color 
  90. as the INSERT button. Note that this is independent of whether the underlying 
  91. table permits duplicate rows or not. This duplicate row may now be edited by 
  92. positioning the cursor on this row and single clicking the SELECT push button 
  93. using mouse button 1. Now position the cursor on the data item in the row to be 
  94. edited and press the RIGHT mouse button. This will cause the selected data item 
  95. to be displayed in a separate window where it may be edited. This procedure may 
  96. be repeated for as many data items within the row as required. Note that 
  97. editing character data does not require that the data be enclosed in single 
  98. quotes. The only time quotes should be used for character data is to include 
  99. leading or trailing blanks. 
  100.  
  101.  
  102. ΓòÉΓòÉΓòÉ 6. Creating DELETE Transactions ΓòÉΓòÉΓòÉ
  103.  
  104.   In order to prepare for a DELETE transaction, single click the DELETE push 
  105. button using mouse button 1. Next position the cursor anywhere in the row to be 
  106. deleted and single click with mouse button 2. This row is now marked for 
  107. deletion and may not be further manipulated. It will be displayed in the same 
  108. color as the DELETE push button. 
  109.  
  110.  
  111. ΓòÉΓòÉΓòÉ 7. Creating UPDATE Transactions ΓòÉΓòÉΓòÉ
  112.  
  113.   To prepare for an UPDATE transaction, single click the UPDATE push button 
  114. using mouse button 1. Next position the cursor on a specific data item to be 
  115. updated and single click with mouse button 2. The selected data item will now 
  116. be displayed in a separate window where it may be edited. The selected row will 
  117. also be displayed in the same color as the UPDATE push button. This procedure 
  118. may be repeated as often as desired on a single row in order to update the data 
  119. in multiple columns. 
  120.  
  121.  
  122. ΓòÉΓòÉΓòÉ 8. Committing the edited data ΓòÉΓòÉΓòÉ
  123.  
  124.   All the above activity simply  prepares data for the appropriate SQL 
  125. transaction.  To actually execute  the SQL transactions, click on the EXECUTE 
  126. push button. At this point, a new window will appear and the user will be 
  127. requested to enter the name of the table against which all the INSERT, UPDATE, 
  128. and DELETE transactions will be executed. This table name is totally 
  129. independent of the table name (or names) specified in the original SQL query. 
  130. Note that this feature gives the user a limited copy capability by executing 
  131. INSERT transactions against a different table. 
  132.  
  133.   After the table name has been entered, separate transactions will be executed 
  134. for each designated row. If these transactions are successful, each one is 
  135. individually followed immediately by a COMMIT transaction. If the transaction 
  136. is unsuccessful, an appropriate SQL error message will be displayed. Processing 
  137. will continue with the next row after the error message has been acknowledged.. 
  138.  
  139.   Once all the transactions have completed, the program returns to the main 
  140. menu where the user is given the option of either terminating the program or 
  141. executing a new SQL SELECT query. 
  142.  
  143.  
  144. ΓòÉΓòÉΓòÉ 9. Locking the data base ΓòÉΓòÉΓòÉ
  145.  
  146.   The program accepts a single command line parameter. This parameter controls 
  147. the isolation level of the database. This command line option consists of 
  148. either a / or a - character. It is immediately followed by the letter L (case 
  149. unimportant). This is immediately followed by the character 1, 2, or 3. 1 
  150. specifies Uncommitted Read isolation. 2 specifies Cursor Stability isolation 
  151. and is the default. 3 specifies Repeatable Read isolation. If an invalid value 
  152. of this parameter is specified, it is simply ignored and the default value is 
  153. used. For a discussion of the significance of these terms, consult the OS/2 DBM 
  154. documentation.